<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of dist_euclidean</title>
  <meta name="keywords" content="dist_euclidean">
  <meta name="description" content="Calculates the Euclidean distance between vectors [FAST].">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html classify -->
<h1>dist_euclidean
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Calculates the Euclidean distance between vectors [FAST].</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function D = dist_euclidean( X, Y ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Calculates the Euclidean distance between vectors [FAST].

 Assume X is an m-by-p matrix representing m points in p-dimensional space and Y is an
 n-by-p matrix representing another set of points in the same space. This function
 compute the m-by-n distance matrix D where D(i,j) is the SQUARED Euclidean distance
 between X(i,:) and Y(j,:).  Running time is O(m*n*p).

 If x is a single data point, here is a faster, inline version to use:
   D = sum( (Y - ones(size(Y,1),1)*x).^2, 2 )';

 INPUTS
   X   - m-by-p matrix of m p dimensional vectors 
   Y   - n-by-p matrix of n p dimensional vectors 

 OUTPUTS
   D   - m-by-n distance matrix

 EXAMPLE
   X=[randn(100,5)]; Y=randn(40,5)+2;
   D = dist_euclidean( [X; Y], [X; Y] ); im(D)

 DATESTAMP
   29-Sep-2005  2:00pm

 See also <a href="dist_chisquared.html" class="code" title="function D = dist_chisquared( X, Y )">DIST_CHISQUARED</a>, <a href="dist_emd.html" class="code" title="function D = dist_emd( X, Y )">DIST_EMD</a></pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="clf_knn.html" class="code" title="function clf = clf_knn( p, k, dist_fn )">clf_knn</a>	Create a k nearest neighbor classifier.</li><li><a href="kmeans2.html" class="code" title="function [IDX,C,sumd] = kmeans2( X,k,varargin )">kmeans2</a>	Very fast version of kmeans clustering.</li><li><a href="meanshiftim_explore.html" class="code" title="function meanshiftim_explore( I, X, sig_spt, sig_rng, show )">meanshiftim_explore</a>	Visualization to help choose sigmas for meanshiftim.</li><li><a href="../classify/private/meanshift_post.html" class="code" title="function [IDX,C] = meanshift_post( X, IDX, C, minCsize, forceoutliers )">meanshift_post</a>	Some post processing routines for meanshift not currently being used.</li></ul>
<!-- crossreference -->



<hr><address>Generated on Wed 03-May-2006 23:48:50 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>